
DECLARE	@task_group_id INT
			, @task_id INT
			, @depends_on_task_id INT

/*
SET @task_group_id = ssf.ptx_get_task_group_id(DEFAULT, 'TEST')
*/
EXECUTE ssf.ptx_insert_task_group
	@group_type = DEFAULT
	, @group_name = 'TEST'
	, @task_group_id = @task_group_id OUTPUT

EXECUTE ssf.ptx_insert_task
	@task_group_id = @task_group_id
	, @task_procedure_name = 'ssf.ptx_print_message'
	, @task_parameter_list = '@message = ''first-task'', @delay = ''00:00:02'''
	, @task_id = @task_id OUTPUT

SET @depends_on_task_id = @task_id

EXECUTE ssf.ptx_insert_task
	@task_group_id = @task_group_id
	, @task_procedure_name = 'ssf.ptx_print_message'
	, @task_parameter_list = '@message = ''second-task'', @delay = ''00:00:02'''
	, @task_id = @task_id OUTPUT

EXECUTE ssf.ptx_insert_task_dependency
	@task_id = @task_id
	, @depends_on_task_id = @depends_on_task_id

SET @depends_on_task_id = @task_id

EXECUTE ssf.ptx_insert_task
	@task_group_id = @task_group_id
	, @task_procedure_name = 'ssf.ptx_print_message'
	, @task_parameter_list = '@message = ''third-task'', @delay = ''00:00:02'''
	, @task_id = @task_id OUTPUT

EXECUTE ssf.ptx_insert_task_dependency
	@task_id = @task_id
	, @depends_on_task_id = @depends_on_task_id
